package com.cbtx.networklib.log

import okhttp3.internal.platform.Platform
import java.util.logging.Level
import java.util.logging.Logger

/**
 * author : joker.peng
 * e-mail : joker@fiture.com
 * date   : 2021/7/1 10:15 AM
 * desc   : 拦截器默认日志打印工具，当构建 LogBuilder 时，未设置 loggable，则使用该工具打印日志
 */
object L {
    fun log(type: Int, tag: String?, msg: String?) {
        val logger = Logger.getLogger(tag)
        when (type) {
            Platform.INFO -> logger.log(Level.INFO, msg)
            else -> logger.log(Level.WARNING, msg)
        }
    }
}